package com.wltt.product.ahuthr.controller;

import com.wltt.product.ahuthr.model.ResultData;
import com.wltt.product.ahuthr.model.vo.FlowStepDetailReq;
import com.wltt.product.ahuthr.model.vo.ListFlowStepReq;
import com.wltt.product.ahuthr.model.vo.ToDoListReq;
import com.wltt.product.ahuthr.service.FlowService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;

@RestController
@RequestMapping(value = "/api/flow")
public class FlowController {

    @Resource
    private FlowService flowService;

    /**
     * 流程详情
     *
     * @return
     */
    @RequestMapping(value = {"/flowStepDetail"}, method = RequestMethod.POST)
    public ResultData flowStepDetail(@RequestBody FlowStepDetailReq flowStepDetailReq) throws IOException {
        return flowService.flowStepDetail(flowStepDetailReq);
    }

    /**
     * 查询流程节点列表
     *
     * @return
     */
    @RequestMapping(value = {"/listFlowStep"}, method = RequestMethod.POST)
    public ResultData listFlowStep(@RequestBody ListFlowStepReq listFlowStepReq) throws IOException {
        return flowService.listFlowStep(listFlowStepReq);
    }

    /**
     * 查询所有系统流程
     *
     * @return
     */
    @RequestMapping(value = {"/listAllSystemFlow"}, method = RequestMethod.POST)
    public ResultData listAllSystemFlow() throws IOException {
        return flowService.listAllSystemFlow();
    }

    /**
     * 代办列表
     *
     * @return
     */
    @RequestMapping(value = {"/toDoList"}, method = RequestMethod.POST)
    public ResultData toDoList(@RequestBody ToDoListReq toDoListReq) throws IOException {
        return flowService.toDoList(toDoListReq);
    }
}
